wiki:XmlRpcDownloadSubtitles

Version 4 (modified by guest, 15 years ago) (diff)

typo

DownloadSubtitles

Intro

download given subtitle files


Description

struct DownloadSubtitles(string $token, array($IDSubtitleFile, $IDSubtitleFile,...) $data)

This function can be used to download multiple subtitle files at once.


Parameters

First parameter is the session token, second is the array/list of subtitle file IDs using this structure:

  array(  <--- array of subtitle file IDs
    (int), (int), ...
  )
token (required)
token string identifying user's session, taken from LogIn output structure.
data (required)
array of subtitle file IDs

Return Values

Output is returned in this structure:

  struct(
    array(
      struct( subcontents ), struct( subcontents ), ...
    ) [data],
    (double) [seconds]
  )

and contains these elements:

status
function result code, see list of status codes
data
array of subtitle file contents
subcontents
subtitle file contents, a struct with 2 members: idsubtitlefile and data (base64 encoded and gzipped subtitle file contents)
data
to get the contents of the subtitle file, first base64-decode the string and then gunzip its contents
seconds
time taken to execute this command on server

Subtitle file contents subcontents structure:

struct(
  (int)    [idsubtitlefile],
  (string) [data]
)

Implementations

There are currently no available sample implementations.


Changelog

Version 1: created this function


Examples

Input

<methodCall>
 <methodName>DownloadSubtitles</methodName>
 <params>
  <param>
   <value><string>0t6bf5qt1l32ol67frupr47fg7</string></value>
  </param>
  <param>
   <value>
    <array>
     <data>
      <value><int>1951894257</int></value>
      <value><int>1951853345</int></value>
      ... more subtitle file IDs if needed go here ...
     </data>
    </array>
   </value>
  </param>
 </params>
</methodCall>

Output

<methodResponse>
 <params>
  <param>
   <value>
    <struct>
     <member>
      <name>status</name>
      <value><string>200 OK</string></value>
     </member>
     <member>
      <name>data</name>
      <value>
       <array>
        <data>
         <value>
          <struct>
           <member>
            <name>idsubtitlefile</name>
            <value><int>1951894257</int></value>
           </member>
           <member>
            <name>data</name>
            <value><string>H4sIAA ... base64-encoded and gzipped subtitle file contents ... BAA==</string></value>
           </member>
          </struct>
         </value>
         ... more subtitle file content structures go here if any ...
        </data>
       </array>
      </value>
     </member>
     <member>
      <name>seconds</name>
      <value>
       <double>0.38</double>
      </value>
     </member>
    </struct>
   </value>
  </param>
 </params>
</methodResponse>


Notes

  • you need to base64-decode and then gunzip subcontents-->data to get the subtitle file contents.

See also


Comments

add your comments, hints and suggestions here if you like ...

[Prev] Home [Next]